package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.AnnualRebateApproval;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.AnnualRebateApprovalSearchDTO;
import com.chenfan.mcn.model.vo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 客户返点审批单 Mapper 接口
 * </p>
 *
 * @author lizhejin
 * @since 2021-03-02
 */
public interface AnnualRebateApprovalMapper extends EnhancedBaseMapper<AnnualRebateApproval> {

    /**
     * 客户返点审批单列表
     *
     * @param page      {@link McnPage}
     * @param searchDTO {@link AnnualRebateApprovalSearchDTO}
     * @return {@link Page<AnnualRebateVO>}
     */
    Page<AnnualRebateVO> getList(McnPage<AnnualRebateVO> page, @Param("dto") AnnualRebateApprovalSearchDTO searchDTO);

    /**
     * 导出
     *
     * @param searchDTO {@link AnnualRebateApprovalSearchDTO}
     * @return {@link List<AnnualExportVo>}
     */
    List<AnnualExportVo> exportExcel(@Param("dto") AnnualRebateApprovalSearchDTO searchDTO);

    /**
     * 获取年度审批单的结算信息
     *
     * @param rebateContractCode {@link String}
     * @return {@link ExcutionSettleInfoVO}
     */
    ExcutionSettleInfoVO getSettle(@Param("rebateContractCode") String rebateContractCode);

    /**
     * 获取年度审批单的账户信息
     *
     * @param rebateContractCodes {@link List<String>}
     * @return {@link InvoiceAccountInfoVO}
     */
    List<InvoiceAccountInfoVO> getBatchRebateSettle(@Param("rebateContractCodes") List<String> rebateContractCodes);

    /**
     * 详情
     *
     * @param id        {@link Long}
     * @param processId {@link Long}
     * @return {@link AnnualRebateInfo}
     */
    AnnualRebateInfo info(Long id, long processId);

    /**
     * 根据折扣审批单号获取客户返点审批单
     *
     * @param discountCode {@link String}
     * @return {@link AnnualRebateApproval}
     */
    AnnualRebateApproval findByDiscountCode(String discountCode);

    /**
     * 获取单笔审批单的结算信息
     *
     * @param chargeSourceCode {@link String}
     * @return {@link ExcutionSettleInfoVO}
     */
    ExcutionSettleInfoVO getCustomerSettle(@Param("chargeSourceCode") String chargeSourceCode);
}
